<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .outer {
    position: relative;
    width: 200px;
    height: 200px;
  }

  .mask {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    background: rgba(0, 0, 0, .7);
    pointer-events: none;
    /* 重要 */
  }
</style>

<body>
  <div class="outer">
    <div class="mask"></div>
    <button id="btn">click</button>
  </div>
  <script>
    const btn = document.getElementById('btn')
    btn.addEventListener('click', function (e) {
      console.log('click');
    })
  </script>
</body>

</html>